package tmp.antlr;

import org.antlr.v4.runtime.ANTLRInputStream;
import org.antlr.v4.runtime.CommonTokenStream;

import a1.ExprLexer;
import a1.ExprParser;

public class Test1 {

	public static void main(String[] args)throws Exception {
		run("2");
		run("a + b + 3");
		run("a + (b * 3");

//		String[] ss = {"Expr", "prog", "-gui"};
//		TestRig.main(ss);
	}

	public static void run(String expr)throws Exception{
		ANTLRInputStream in = new ANTLRInputStream(expr);
		ExprLexer lexer = new ExprLexer(in);
		CommonTokenStream tokens = new CommonTokenStream(lexer);
		ExprParser exprParser = new ExprParser(tokens);
		exprParser.prog();
	}
}
